/*
 * @Author: huangpan02
 * @Date: 2023-02-20 11:25:09
 * @LastEditTime: Please set LastEditors
 * @LastEditors: Please set LastEditors
 * @Description: 计量设备归还管理API
 */
import request from '@/utils/request'
import { faceProducerApiUrl } from '@/api/config'
// let _apiUrl = 'http://192.168.10.60:10400'
export default {
  /**
   * @description: 获取列表
   * @param {Object} data：body参数
   * @return {Promise}
   */
  list(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturn/getPageMdInfoReturn`, method: 'post', data
    })
  },
  /**
 * @description: 添加
 * @param {Object} data：body参数
 * @return {Promise}
 */
  create(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturn/insertSelective`, method: 'post', data
    })
  },
  /**
   * @description: 计量设备归还管理统计数量
   * @param {Object} data：body参数
   * @return {Promise}
   */
  getCountByMdStatus(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturn/statisticsMdReturn`, method: 'post', data
    })
  },
  /**
   * @description: 详情
   * @param {String} id：业务id
   * @return {Promise}
   */
  getDetail({ id }) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturn/getMdInfoReturnById?id=${id}`, method: 'get'
    })
  },
  /**
 * @description: 查询计量设备归还清单列表
 * @param {Object} data：body参数
 * @return {Promise}
 */
  queryMdInfoReturnInventoryList(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturnInventory/queryMdInfoReturnInventoryList`, method: 'post', data
    })
  },
  /**
   * @description: 导出
   * @param {Object} data：body参数
   * @return {Promise}
   */
  exportData(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturn/export`,
      method: 'post',
      data,
      responseType: 'blob',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  /**
   * @description: 获取待处理的归还确认
   * @param {Object} data：body参数
   * @return {Promise}
   */
  getWaitDealInfo(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturnInventory/getWaitDealInfo?returnInventoryId=${data.returnInventoryId}`, method: 'post'
    })
  },
  /**
   * @description: 处理归还信息
   * @param {Object} data：body参数
   * @return {Promise}
   */
  dealReturn(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfoReturnInventory/dealReturn`, method: 'post', data
    })
  },
}